﻿<Page
    x:Class="IntegrationExampleLauncher.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:IntegrationExampleLauncher"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.ChildrenTransitions>
            <TransitionCollection>
                <EntranceThemeTransition/>
            </TransitionCollection>
        </Grid.ChildrenTransitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Horizontal scrolling grid -->
        <Grid Grid.Row="1" Margin="120,0, 20, 50">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="20"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.Resources>
                <Style TargetType="TextBlock" BasedOn="{StaticResource BaseTextBlockStyle}">
                    <Setter Property="Margin" Value="0,10,0,10"></Setter>
                </Style>
            </Grid.Resources>
            <StackPanel Grid.Column="0">
                <TextBlock Text="File Activation" Style="{StaticResource SubheaderTextBlockStyle}"/>
                <TextBlock Text="Selected File: "/>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <TextBox Grid.Column="0" x:Name="FileNameTextBox" IsEnabled="False"/>
                    <Button Grid.Column="1" Content="Select..." Click="HandleFileActivationFileSelectionClick"/>
                </Grid>
                
                <TextBlock Text="View Preference:"/>
                <StackPanel x:Name="FileViewPreferences">
                    <RadioButton Content="Default" Tag="Default" GroupName="FileActivationPreference" IsChecked="True" />
                    <RadioButton Content="Use Less" Tag="UseLess" GroupName="FileActivationPreference"  />
                    <RadioButton Content="Use More" Tag="UseMore" GroupName="FileActivationPreference"  />
                    <RadioButton Content="Use Half" Tag="UseHalf" GroupName="FileActivationPreference" />
                    <RadioButton Content="Use Minimum" Tag="UseMinimum" GroupName="FileActivationPreference" />
                </StackPanel>
                <TextBlock Text="Application Picker:"/>
                <CheckBox x:Name="DisplayFileApplicationPickerCheckBox" Content="Display Application Picker Dialog"/>
                
                <Button x:Name="LaunchFileActivationButton" Content="Launch" HorizontalAlignment="Center" Click="HandleLaunchFileActivationClick"/>
            </StackPanel>
            <StackPanel Grid.Column="2">
                <TextBlock Text="Protocol Activation" Style="{StaticResource SubheaderTextBlockStyle}"/>
                <TextBlock Text="Selected Contact: "/>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <TextBox Grid.Column="0" x:Name="ContactNameTextBox" IsEnabled="False"/>
                    <Button Grid.Column="1" Content="Select..." Click="HandleProtocolActivationContactSelection"/>
                </Grid>

                <TextBlock Text="View Preference:"/>
                <StackPanel x:Name="ProtocolViewPreferences">
                    <RadioButton Content="Default" Tag="Default" GroupName="ProtocolActivationPreference" IsChecked="True" />
                    <RadioButton Content="Use Less" Tag="UseLess" GroupName="ProtocolActivationPreference" />
                    <RadioButton Content="Use More" Tag="UseMore" GroupName="ProtocolActivationPreference" />
                    <RadioButton Content="Use Half" Tag="UseHalf" GroupName="ProtocolActivationPreference"  />
                    <RadioButton Content="Use Minimum" Tag="UseMinimum" GroupName="ProtocolActivationPreference" />
                </StackPanel>

                <TextBlock Text="Application Picker:"/>
                <CheckBox x:Name="DisplayProtocolApplicationPickerCheckBox" Content="Display Application Picker Dialog"/>

                <Button x:Name="LaunchProtocolActivationButton" Content="Launch" HorizontalAlignment="Center" Click="HandleLaunchProtocolActivationClick"/>

            </StackPanel>
        </Grid>

        <!-- Back button and page title -->
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <!--<Button x:Name="BackButton" Margin="39,59,39,0" Command="{Binding NavigationHelper.GoBackCommand, ElementName=PageRoot}"
                        Style="{StaticResource NavigationBackButtonNormalStyle}"
                        VerticalAlignment="Top"
                        AutomationProperties.Name="Back"
                        AutomationProperties.AutomationId="BackButton"
                        AutomationProperties.ItemType="Navigation Button"/>-->
            <TextBlock x:Name="PageTitle" Text="{StaticResource AppName}" Style="{StaticResource HeaderTextBlockStyle}" Grid.Column="1" 
                        IsHitTestVisible="false" TextWrapping="NoWrap" VerticalAlignment="Bottom" Margin="0,0,30,40"/>
        </Grid>
    </Grid>
</Page>
